#ifndef __surroundplugin__
#define __surroundplugin__

#ifndef __adelay__
#include "plugin.h"
#endif

#define MAX_CHANNELS 6  // maximun number of channel

//------------------------------------------------------------------------
// SurroundDelay declaration
//------------------------------------------------------------------------
class SurroundPlugin : public Plugin
{
public:
	SurroundPlugin (audioMasterCallback audioMaster);
	~SurroundPlugin ();

	virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleframes);

	void setParameter (VstInt32 index, float value);

	// functions VST version 2
	virtual bool getVendorString (char* text) { if (text) strcpy (text, "Bc. Vojtech Prehnal"); return true; }
	virtual bool getProductString (char* text) { if (text) strcpy (text, "NM-02 Volume Maximizer"); return true; }
	virtual VstInt32 getVendorVersion () { return 2004; }

	virtual VstPlugCategory getPlugCategory () { return kPlugSurroundFx; }
	
	virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput);
	virtual bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput);

	virtual void resume ();

private:
	VstSpeakerArrangement* plugInput;
	VstSpeakerArrangement* plugOutput;

	int GainDB;
    float LastGain[MAX_CHANNELS];
    float LastSample[MAX_CHANNELS];
};

#endif
